<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->string('user_name',30)->unique()->comment('账号');
            $table->string('nickname',50)->default('')->comment('昵称');
            $table->string('password',100)->default('')->comment('密码');
            $table->unsignedTinyInteger('sex')->default(0)->comment('0保密，1男，2女');
            $table->unsignedInteger('city')->default(0)->comment('城市id');
            $table->string('head_img')->default('')->comment('头像');
            $table->timestamps();
            $table->softDeletes();
        });
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE `old_liu_users` COMMENT='用户表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
